FUNCTION

register_crosschain_asset

function register_crosschain_asset(asset_id: byte_array, name: text, symbol: text, decimals: integer, issuing_blockchain_rid: byte_array, icon_url: text, type: text, uniqueness_resolver: byte_array, origin_blockchain_rid: byte_array): asset_origin

Registers a crosschain asset on this chain. Since this could be used to register many assets and use up a lot of storage space, it is marked as Unsafe

Can only be called from an operation.

Throws "INVALID ORIGIN" when the origin blockchain RID is the blockchain RID of this chain.

Throws "INVALID ISSUING CHAIN" when the issuing blockchain RID is the blockchain RID of this chain.

Throws if the input parameters are invalid. Common cases include:

  • IDs are not 32 bytes long
  • strings are longer than 1024 characters
  • type is empty
  • uniqueness resolver is longer than 1024 bytes
  • decimals is not in the accepted range [0, 78] (inclusive)
  • icon_url is not a valid URL

Parameters

  • asset_id — the ID of the asset to be registered
  • name — the name of the asset to be registered
  • symbol — the symbol of the asset to be registered
  • decimals — the decimals of the asset to be registered
  • issuing_blockchain_rid — the first chain where the asset was registered
  • icon_url — the URL of the icon for the asset, can be an empty string in the case of no icon
  • type — the type of the asset to be registered. In most cases, this should be the value of core.asset.ASSET_TYPE_FT4
  • uniqueness_resolver — the uniqueness resolver for the asset. In most cases, this is not needed and it can be set to x""
  • origin_blockchain_rid — the blockchain we'll receive this asset from. This is not necessarily the same as issuing_blockchain_rid, but it will often be.

See Also

  • [asset_origin] — for information on the origin_blockchain_rid parameter
  • [core.assets.asset] — for informations on all other parameters
© 2024 Chromia